package demo;

public class exceptionText {
    public static void main(String[] args) {
        int[] arr = new int[] {1, 2, 3, 4};
        try {
            for (int i = 0; i < 5; i++) {
                System.out.println(arr[i]);
            }
        } catch (Exception e) {
            System.out.println("代码出问题了!!!");
        } finally {
            System.out.println("我总会执行，可写可不写");
        }
    }
}
